﻿CREATE TABLE DBBackOffice.DBOrderExecution (
	ID				uniqueidentifier PRIMARY KEY,							/* Unique GUID for this execution */
	DBOrderID		uniqueidentifier NOT NULL,								/* Related to this order */
	Quantity		integer NOT NULL CHECK (Quantity>0),					/* for this quantity */
	Price			float NOT NULL CHECK (Price>0),							/* at this price */							
	TimeStamp 		datetime2 NOT NULL,										/* Date */
	CounterParty	varchar(255),											/* deal made with this counterparty, free to store there whatever is needed to identify the other side */
			
	FOREIGN KEY (DBOrderID) REFERENCES DBBackOffice.DBOrder(ID) ON DELETE CASCADE,
);